/*
 * @Author: your name
 * @Date: 2021-07-27 09:10:09
 * @LastEditTime: 2021-07-27 16:12:12
 * @LastEditors: Please set LastEditors
 * @Description: gulp-css-wrap管理主题包
 * @FilePath: \vue-element-th\gulpfile.js
 */

// gulpfile.js
let path = require("path");
let gulp = require("gulp");
let cleanCSS = require("gulp-clean-css");
let cssWrap = require("gulp-css-wrap");
let merge = require("merge-stream");
// console.log("进到gulpFile----------------", path);
gulp.task("css-wrap", function() {
  let css = gulp
    .src(path.resolve("./theme/index.css"))
    /* 找需要添加命名空间的css文件，支持正则表达式 */
    .pipe(cssWrap({ selector: ".custom-white" /* 添加的命名空间 */ }))
    .pipe(cleanCSS())
    .pipe(gulp.dest("src/assets/theme/white"));
  /* 存放的目录 */
  let font = gulp
    .src("./theme/fonts/**")
    .pipe(gulp.dest("src/assets/theme/white/fonts"));
  return merge(css, font);
});
